package com.aistar.service.impl;

import com.aistar.mapper.ProgramRecordMapper;
import com.aistar.pojo.ProgramRecord;
import com.aistar.service.ProgramRecordService;
import com.aistar.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProgramRecodeServiceImpl implements ProgramRecordService {
    private final ProgramRecordMapper mapper;

    @Autowired
    public ProgramRecodeServiceImpl(ProgramRecordMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public ServerResponse add(ProgramRecord programRecord) {
        int rows = mapper.insertSelective(programRecord);
        if (rows>0)
            return ServerResponse.addSuccess();
        return ServerResponse.addFailed();
    }
}
